package com.gitee.wsl.mathematics.vector.ext

import com.gitee.wsl.mathematics.coordinate.d2.Coordinate2
import com.gitee.wsl.mathematics.coordinate.d3.Coordinate3

//infix fun<T:Number,V:Coordinate2<T, V>> Coordinate2<T, V>.cross(other: Coordinate2<T, V>):T = x * other.x - y * other.y
//infix fun<T:Number> Coordinate2<T, *>.cross(other: Coordinate2<T, *>):T = x * other.x - y * other.y

infix fun<T:Number> Coordinate2<T, *>.cross(other: Coordinate3<T, *>)  = (other cross this)

infix fun<T:Number> Coordinate3<T, *>.cross(other: Coordinate2<T, *>)
        = create(-z * other.y, z * other.x, x * other.y - y * other.x) as Coordinate3<T, *>

//infix fun<T:Number,V: Coordinate3<T, V>> Coordinate3<T, V>.cross(other: Coordinate3<T, *>):V = create(
//    y * other.z - z * other.y,
//    z * other.x - x * other.z,
//    x * other.y - y * other.x
//)
